
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>right</title>
    <link rel="stylesheet" href="./css/main.css">
    <link rel="stylesheet" href="./css/style.css">
    <link rel="stylesheet" href="./css/animate.css">
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/bootstrap.css">
    <link rel="stylesheet" href="./css/normalize.css">
    <script src="./js/check.js"></script>
</head>
<body style="background: #252c35;height: 100%">
<div class="mScroll">
    <div class="container">
        <div class="jsbg">
            <div class="col-lg-12 mxlength">
                <?php if($type):?>
                    <h5>修改商品</h5>
                <?php else:?>
                    <h5>添加商品</h5>
                <?php endif;?>
                <form action="./addProduct.php" method="post" enctype="multipart/form-data">
                    <table class="shops ss container-fluid spow">
                        <tr>
                            <input type="hidden" value="<?=$type?>" name="editType">
                            <input type="hidden" value="<?=$selectResult['id']?>" name="proId">
                            <td>商品名称：<input type="text" name="productName" id="productName" required value="<?=$selectResult['name']?>"></td>
                            <td>商品价格：<input type="text" name="productPrice" id="productPrice" onkeyup="num(this)" required value="<?=$selectResult['price']?>"></td>
                        </tr>
                        <tr>
                            <td>商品数量：<input type="text" name="productPnum" id="productPnum" onkeyup="checkNum(this)" required value="<?=$selectResult['pnum']?>"></td>
                            <td>商品分类：
                                <select name="category" >
                                    <option value="">-----选择商品类型-----</option>
                                    <?php if(is_array($cates)): foreach($cates as $cate):?>
                                    <option value="<?=$cate['id']?>" <?=($cate['id']==$selectResult['category'])?'selected':''?>><?=$cate['category']?></option>
                                    <?php endforeach; endif;?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                商品照片：<input type="file" name="imgUrl">
                                <input type="hidden" value="<?=$selectResult['imgurl']?>" name="imgUrl1">
                            </td>
                        </tr>
                        <tr>
                            <td>商品描述：
                                <textarea name="description" cols="50" rows="5" ><?=$selectResult['description']?></textarea>
                            </td>
                        </tr>
                        <div class="btn-group shop-btn" role="group" aria-label="Basic example">
                            <a href="" style="color: red;"><?=setMsg($msg)?></a>
                            <button type="submit" class="btn btn-primary">确定</button>
                            <button type="reset" class="btn btn-primary">重置</button>
                            <button type="button" class="btn btn-primary" onclick="history.go(-1)">返回</button>
                        </div>
                    </table>

                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="./js/bootstrap.bundle.js"></script>
<script type="text/javascript" src="./js/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="./js/style.js"></script>

</body>

</html>
